import React, { useState } from "react";
import { hooks, Calendar, Cell} from 'react-vant';
import {Button} from 'antd'

type Props = {};



function Index({}: Props) {
    const formatDate = (date:any) => `${date.getMonth() + 1}/${date.getDate()}`;
    const [state, set] = hooks.useSetState({
        single: false,
        singleText: '',
        multi: false,
        multiText: '',
        between: false,
        betweenText: '',
      });
  return (
    <div className="box">
      <Cell
        title="选择单个日期"
        value={state.singleText}
        isLink
        onClick={() => set({ single: true })}
      />
      <Calendar
        visible={state.single}
        onClose={() => set({ single: false })}
        onConfirm={(v) => {
          set({ single: false, singleText: formatDate(v) });
        }}
      />
    </div>
  );
}

export default Index;
